package hushi.controller;

import hushi.entity.User;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import sun.management.Agent;
import hushi.entity.User;

/**
 *
 */
@org.springframework.stereotype.Controller
public class Controller {
    String text;
    @ModelAttribute
    public String userinfo(){
        text="豫章故郡，洪都新府。星分翼轸，地接衡庐。襟三江而带五湖，控蛮荆而引瓯越。物华天宝，龙光射牛斗之墟；人杰地灵，徐孺下陈蕃之榻。雄州雾列，俊采星驰。台隍枕夷夏之交，宾主尽东南之美。都督阎公之雅望，棨戟遥临；宇文新州之懿范，襜帷暂驻。十旬休假，胜友如云；千里逢迎，高朋满座。腾蛟起凤，孟学士之词宗；紫电青霜，王将军之武库。家君作宰，路出名区；童子何知，躬逢胜饯。";
        return text;
    }
    @GetMapping(value = "search")
    public ModelAndView doCN_zh(Model attributes){
        attributes.addAttribute("txt",text);
        System.out.println(text);
        System.out.println(attributes);
        return new ModelAndView("/search.jsp");
    }
}
